(*************************************************** Ant Movie Catalog importation script www.antp.be/software/moviecatalog/ [Infos] Authors=Bobo Title=dvd-maxxx.com Description=dvd-maxxx.com (FR) - Recherche de films Site=dvd-maxxx.com Language=FR Version= Requires=3.5.0 Comments= License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. | GetInfo=1 [Options] ***************************************************) program DvdMaxxx; const ConfirmTitre = 1; { 1: Demande le titre avant de lancer le script 2: Ne demande pas le titre avant de lancer le script, 0 : Ne demande aucune comfirmation, 3 : Aucune Confirmation Premier Film si multiples resultats} // Pour récupérer ou non un champs TitreTraduitConst = True; TitreOrignalConst = True; CategorieConst = True; AdresseWebConst = True; SynopsisConst = True; var MovieName, Adresse, AdressePlus, La_liste, LaAllocine_FR, LaPremiereGrandeImage, Reponse, AdresseSuivant, AdressePrecedent, LePremierFilmAdresse, strTemp, aucunAmazon : string; numPage, numPageG, numPageR, grandeTaille, premiereTaille, compteur, premiereExecution, numTemp : Integer; //------------------------------------------------------------------------------ // TROUVE UNE SOUS-CHAINE DE CARACTERE DANS UNE CHAINE //------------------------------------------------------------------------------ function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer; var i: Integer; begin result := -1; if StartAt < 0 then StartAt := 0; for i := StartAt to List.Count-1 do if Pos(Pattern, List.GetString(i)) <> 0 then begin result := i; Break; end; end; //------------------------------------------------------------------------------ // ANALYSE DE LA PAGE DE RECHERCHES //------------------------------------------------------------------------------ procedure AnalyzePage(Address: string); var Page: TStringList; LineNr: Integer; Line: string; BeginPos, EndPos : Integer; begin Page := TStringList.Create; Page.Text := GetPage(Address); if pos('Aucun produit',Page.Text) <> 0 then begin if (ConfirmTitre = 1) or (ConfirmTitre = 2) then begin showmessage('Aucun film trouvé pour : '+MovieName); exit; end else begin SetField(fieldURL, 'DVD Maxxx : aucun résultat'); exit; end; end; PickTreeClear; //on se limite à la section où ya les liens du résultat de la recherche BeginPos := Pos('vAlign=bottom align="center">Les co-locataires - DVD if TitreTraduitConst = True then begin BeginPos := pos('', Line); delete(Line,1, BeginPos+3); // +3 : une pette marge BeginPos := pos('>', Line)+1; EndPos := pos('', Line); Value := copy(Line, BeginPos, EndPos - BeginPos); if pos(' - DVD', Value) >0 then begin delete(Value,pos(' - DVD', Value),6); end; if pos(' - VHS', Value) >0 then begin delete(Value,pos(' - VHS', Value),6); end; Value := AnsiUpFirstLetter(Value); Value := AnsiMixedCase(Value,' -'); SetField(fieldTranslatedTitle, Value); end; //titre originale (ici = titre) if TitreOrignalConst = True then begin SetField(fieldOriginalTitle, Value); end; // Affiche BeginPos := pos('', Line); Value := copy(Line,BeginPos, length(Line)-BeginPos+1); BeginPos := pos(' 0 then begin delete(Value, pos('https', Value)+4,1); end; GetPicture(Value); // Résumé DureeProdReal := 1; BeginPos := pos('

Scénario: ', Line)+31; if BeginPos > 31 then begin Value := copy(Line,BeginPos, length(Line)-BeginPos+1); EndPos := pos('', Value)-1; Value := copy(Value,1, EndPos); if pos('Points forts', Value) >0 then begin //points forts dans Commentaires Value2 := copy(Value, pos('Points forts', Value)+14, EndPos); SetField(fieldComments, cleanText(Trim(Value2))); delete(Value, pos('Points forts', Value)-1, EndPos); end else if pos('Points Forts', Value) >0 then begin Value2 := copy(Value, pos('Points Forts', Value)+14, EndPos); SetField(fieldComments, cleanText(Trim(Value2))); delete(Value, pos('Points Forts', Value)-1, EndPos); end; SetField(fieldDescription, Trim(cleanText(Value))); end else begin DureeProdReal := 0; BeginPos := pos('value="Ajouter au panier"', Line); Value := copy(Line, BeginPos, length(Line)-BeginPos+1); BeginPos := pos('
', Value)+4; EndPos := pos('
', Value)-1; Value := copy(Value,BeginPos, EndPos-BeginPos+1); SetField(fieldDescription, Trim(cleanText(Value))); end; // durée if DureeProdReal = 1 then begin BeginPos := pos('Fiche technique:', Line)+33; Value := copy(Line,BeginPos, 30); //une marge BeginPos := pos('durée', Value); Value := copy(Value, BeginPos, 20); // marge BeginPos := pos('h', Value)-1; Value := copy(Value,BeginPos, 4); //style 1h12 Value := h2m(Value); SetField(fieldLength, Value); // producteur // exemple : Studio: Colmax

BeginPos := pos('Studio:', Line); delete(Line,1, BeginPos+3); // +3 : une pette marge BeginPos := pos('>', Line)+2; EndPos := pos('

', Line); Value := copy(Line, BeginPos, EndPos - BeginPos); SetField(fieldProducer, cleanText(Trim(Value))); // réalisateur // exemple : Réalisateur: Judy Blue BeginPos := pos('Réalisateur:', Line); delete(Line,1, BeginPos+3); // +3 : une pette marge BeginPos := pos('>', Line)+2; EndPos := pos('